import {request as requestApi} from '../utils/requsetApi';
import {gptChatUrl,} from './url'
// 登录接口
export async function accountLogin(params) {
  return requestApi({
    url: gptChatUrl.chatUrl + '/synonymConfig/login',
    method: 'POST',
    data: params,
  });
}

// 获取验证码
export async function getCodeImg() {
  return requestApi({
    url: gptChatUrl.chatUrl + '/synonymConfig/captchaImage',
    method: 'GET',
  });
}
// // 登出借口
// export async function logout(params) {
//   return request(`${url}/logout`, {
//     method: 'POST',
//     data: params,
//   });
// }

export async function getUserInfo() {
  return requestApi({
    url: `${gptChatUrl.userUrl}/user/getUserInfo`,
    method: "GET",
  });

  /*  return {
    success: false,
    message: "该值不可用，系统中已存在！",
    code: 200,
    result: {
      userInfo: {
        id: "e9ca23d68d884d4ebb19d07889727dae",
      },
    },
  };*/
}
export async function queryUserRole(params) {
  //参数userid
  return requestApi({
    url: `${gptChatUrl.userUrl}/dataPermissions/queryTreeList`,
    method: "GET",
    params: params,
  });

  /*  return {
    success: false,
    message: "该值不可用，系统中已存在！",
    code: 0,
    result: ["1818939516552142849", "1818931512272371714"],
  };*/
}
export async function checkToken(params) {
  //参数userid
  return requestApi({
    url: gptChatUrl.chatUrl + '/synonymConfig/oneClickLogin',
    method: 'POST',
    data: params,
  });
}
